Frames No Frames Cognitoware API v2009512
Cognitoware.Robotics.dll
Cognitoware.Mathematics.Probability.Discrete

Class DistributionValueMap<T>
T: The type of the values whose probabilities are represented in the distribution.

System.Object

Implemented Interfaces

Cognitoware.Mathematics.SelfProduct<DistributionValueMap<T>>

Summary

A discrete distribution that uses a Dictionary to map values to probabilities.

Constructor Summary

DistributionValueMap()
Creates a empty distribution.
DistributionValueMap(IEnumerable<T>)
Create a uniform distribution across the values in the parameter iterator.
DistributionValueMap(T)
Create a distribution a single value at 100%.
DistributionValueMap(T, Double, T, Double)
Create a distribution with two values.

Method Summary

AliasAs()
Inherited from Cognitoware.Mathematics.Probability.RandomDistribution
Equals(Object)
Inherited from System.Object
Finalize()
Inherited from System.Object
GetEntropy()
Inherited from Cognitoware.Mathematics.Probability.Discrete.DiscreteDistribution
GetEntropy(IEnumerable<T>)
Inherited from Cognitoware.Mathematics.Probability.RandomDistribution
GetHashCode()
Inherited from System.Object
GetType()
Inherited from System.Object
MemberwiseClone()
Inherited from System.Object
Normalize()
Normalizes the distribution so that the sum of probabilities over X sums to one.
ProbabilityOf(T)
Returns the probability of a discrete event or the probability density of a continuous event.
Product(DistributionValueMap<T>)
Mutiplies this MappedDistribution by a MappedDistribution to mean in a new MappedDistribution.
Sample(Random)
Selects a random value from the distribution with a probability consistent with the distribution.
Set(T, Double)
Maps values of T to a probability value.
ToString()
Creates a string representation of the matrix.

Details

A discrete distribution that uses a Dictionary to map values to probabilities.

Constructor Details

public DistributionValueMap()
Creates a empty distribution.

public DistributionValueMap(IEnumerable<T> domain)
Create a uniform distribution across the values in the parameter iterator.

Parameters:

domain - An iterator across all values for the distribution.

public DistributionValueMap(T t0)
Create a distribution a single value at 100%.

Parameters:

t0 - The first value of T.

public DistributionValueMap(T t0, Double v0, T t1, Double v1)
Create a distribution with two values.

Parameters:

t0 - The first value of T.
v0 - The probability of the first value of T.
t1 - The second value of T.
v1 - The probability of the second value of T.

Method Details

public void Normalize()
Normalizes the distribution so that the sum of probabilities over X sums to one.

public override Double ProbabilityOf(T t)
Returns the probability of a discrete event or the probability density of a continuous event. Simply looks up the specified value in the backing Dictionary.

Parameters:

t - The values whose probability is returned.

Returns:

The probability of t.

public final virtual DistributionValueMap<T> Product(DistributionValueMap<T> that)
Mutiplies a MappedDistribution by a MappedDistribution to mean in a new MappedDistribution. The operation multiplies the probabilities of each value of T. Product is used to collapse distribution representations during Bayesian inferencing.

Parameters:

that - The second operand in the multiplication.

Returns:

A new binomial combining the information from the two binomial arguments.

public override T Sample(Random select)
Selects a random value from the distribution with a probability consistent with the distribution.

Parameters:

select - A random number generator used to select the value.

Returns:

A value of T.

public void Set(T t, Double p)
Maps values of T to a probability value.

Parameters:

t - The value whose probability is being calculated.
p - The probability of t.

public override String ToString()
Creates a string representation of the matrix.

Returns:

A string representation of the matrix.


Questions, Comments and Licensing
Copyright 2009 Cognitoware. All rights reserved.